﻿using System;
using System.Collections.Specialized;

namespace AspNetMvc.Helpers
{
    internal class PostValuesRetrievingHelper
    {
        public static string GetValue(NameValueCollection collection, string key)
        {
            string value = null;

            string[] values = collection.GetValues(key);
            if (values != null && values.Length == 1 && !String.IsNullOrEmpty(values[0]))
                value = values[0];

            return value;
        }
    }
}